﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace LX.NHibernate.Data
{
    public interface IRepository<T> where T : class
    {
        object Insert(T entity);

        void Update(T entity);

        void Delete(T entity);

        T Get(object id);

        T Load(object id);

        List<T> LoadAll();
        
        List<T> LoadAllWithPage(out long count, int pageIndex, int pageSize);

        IList<T> GetListForPage(Expression<Func<T, bool>> where, Expression<Func<T, object>> order, int pageIndex, int pageSize, out int Total);

    }
}
